package com.yctan;


import java.io.*;

public class FileIo {
    public static void main(String[] args) {
        FileInputStream fileInputStream = null;
        try {
            fileInputStream = new FileInputStream("C:\\Users\\yctan-pc\\Desktop\\新建 文本文档.txt");
            byte[] bytes = new byte[1024];
            System.out.println(Thread.currentThread().getName()+fileInputStream.read(bytes));
            File file = new File("C:\\Users\\yctan-pc\\Desktop\\新建 文本文档2.txt");
            file.createNewFile();
            FileOutputStream fileOutputStream = new FileOutputStream(file);
            fileOutputStream.write(bytes);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
